package com.huawei;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Description:
 *
 * @author weiruibai.vendor
 * Date: 2022/10/19 09:52
 */
public class HJ59 {


    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String str = reader.readLine();
        while (str != null && str.length() > 0) {
            boolean isOut = false;
            char[] chars = str.toCharArray();
            int n = chars.length;
            for (int i = 0; i < n; i++) {
                int count = 0;// 计算个数
                for (int j = 0; j < chars.length; j++) {
                    if (chars[i] == chars[j]) {
                        count++;
                    }
                }
                if (count == 1) {
                    System.out.println(chars[i]);
                    isOut = true;// 标识
                    break;
                }
            }
            if (!isOut) {
                System.out.println(-1);
            }
            str = reader.readLine();
        }

    }
}
